// ts的函数 限定形参类型  返回值类型
// ? 可忽略参数 设计到最后
function sau(a:string="12",b:boolean,c?:any):Array<number>{
  console.log(a)
  console.log(b)
  console.log(c)
  return [1,23,34]
}
sau("sdf",true)
// 接口 interface 是用来限定对象的模型\
// 可忽略属性 ?
interface Iperson{
  name:string,
  age:number,
  readonly sex:string, //readonly 只读属性 不能修改
  shengao?:number, //可忽略属性
  hobby:Array<string>,
  eat():void,
  sleep(h:number,s:string):number 
}
let laowang:Iperson={
    name:"隔壁老王",
    age:18,
    sex:"男",
    hobby:["翻墙","隐蔽","逃跑"],
    eat(){},
    sleep(h:number,s:string){
      return 999
    }
}
// 车的对象的接口模型
interface Icar{
  name:string,
  color:string,
  speed:number,
}

let q8:Icar={
  name:"8手qq",
  color:"红色",
  speed:280
}
var arr9:Array<Icar>=[
  {
    name:"奔驰",
    color:"红色",
    speed:180
  },{
    name:"奔驰1",
    color:"红色1",
    speed:1802
   }
  ]
  interface Irouter{
    path:string,
    name:string,
    component?:object
  }

  let routes:Array<Irouter>=[{
    path:"/home",
    name:"home",
  },{
    path:"/list",
    name:"list",
  }]
